/*   1:    */ package com.atomikos.icatch.jta;
/*   2:    */ 
/*   3:    */ import com.atomikos.icatch.admin.imp.SimpleLogAdministrator;
/*   4:    */ import com.atomikos.icatch.config.TSInitInfo;
/*   5:    */ import com.atomikos.icatch.config.UserTransactionService;
/*   6:    */ import com.atomikos.icatch.config.UserTransactionServiceImp;
/*   7:    */ import com.atomikos.util.SerializableObjectFactory;
/*   8:    */ import java.io.Serializable;
/*   9:    */ import javax.naming.NamingException;
/*  10:    */ import javax.naming.Reference;
/*  11:    */ import javax.naming.Referenceable;
/*  12:    */ import javax.transaction.HeuristicMixedException;
/*  13:    */ import javax.transaction.HeuristicRollbackException;
/*  14:    */ import javax.transaction.NotSupportedException;
/*  15:    */ import javax.transaction.RollbackException;
/*  16:    */ import javax.transaction.SystemException;
/*  17:    */ import javax.transaction.TransactionManager;
/*  18:    */ import javax.transaction.UserTransaction;
/*  19:    */ 
/*  20:    */ public class UserTransactionImp
/*  21:    */   implements UserTransaction, Serializable, Referenceable
/*  22:    */ {
/*  23:    */   private transient TransactionManager txmgr_;
/*  24:    */   
/*  25:    */   private void checkSetup()
/*  26:    */   {
/*  27: 81 */     synchronized (TransactionManagerImp.class)
/*  28:    */     {
/*  29: 83 */       this.txmgr_ = TransactionManagerImp.getTransactionManager();
/*  30: 94 */       if (this.txmgr_ == null)
/*  31:    */       {
/*  32: 95 */         UserTransactionService uts = new UserTransactionServiceImp();
/*  33: 96 */         TSInitInfo info = uts.createTSInitInfo();
/*  34: 97 */         uts.registerLogAdministrator(SimpleLogAdministrator.getInstance());
/*  35:    */         
/*  36: 99 */         uts.init(info);
/*  37:100 */         this.txmgr_ = TransactionManagerImp.getTransactionManager();
/*  38:    */       }
/*  39:    */     }
/*  40:    */   }
/*  41:    */   
/*  42:    */   public void begin()
/*  43:    */     throws NotSupportedException, SystemException
/*  44:    */   {
/*  45:114 */     checkSetup();
/*  46:115 */     this.txmgr_.begin();
/*  47:    */   }
/*  48:    */   
/*  49:    */   public void commit()
/*  50:    */     throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SystemException, IllegalStateException, SecurityException
/*  51:    */   {
/*  52:128 */     checkSetup();
/*  53:129 */     this.txmgr_.commit();
/*  54:    */   }
/*  55:    */   
/*  56:    */   public void rollback()
/*  57:    */     throws IllegalStateException, SystemException, SecurityException
/*  58:    */   {
/*  59:139 */     checkSetup();
/*  60:140 */     this.txmgr_.rollback();
/*  61:    */   }
/*  62:    */   
/*  63:    */   public void setRollbackOnly()
/*  64:    */     throws IllegalStateException, SystemException
/*  65:    */   {
/*  66:150 */     checkSetup();
/*  67:151 */     this.txmgr_.setRollbackOnly();
/*  68:    */   }
/*  69:    */   
/*  70:    */   public int getStatus()
/*  71:    */     throws SystemException
/*  72:    */   {
/*  73:160 */     checkSetup();
/*  74:161 */     return this.txmgr_.getStatus();
/*  75:    */   }
/*  76:    */   
/*  77:    */   public void setTransactionTimeout(int seconds)
/*  78:    */     throws SystemException
/*  79:    */   {
/*  80:170 */     checkSetup();
/*  81:171 */     this.txmgr_.setTransactionTimeout(seconds);
/*  82:    */   }
/*  83:    */   
/*  84:    */   public Reference getReference()
/*  85:    */     throws NamingException
/*  86:    */   {
/*  87:182 */     return SerializableObjectFactory.createReference(this);
/*  88:    */   }
/*  89:    */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions-jta\3.7.0\transactions-jta-3.7.0.jar
 * Qualified Name:     com.atomikos.icatch.jta.UserTransactionImp
 * JD-Core Version:    0.7.0.1
 */